package dataImport.model;

public class PlaceDescription extends Description {

	private static final long serialVersionUID = -624135230029666624L;

	private Place placeRelatedTo;

	public PlaceDescription(final String id, final State state, final Text text, final Place placeRelatedTo) {
		super(id, state, text);
		this.placeRelatedTo = placeRelatedTo;
	}

	public Place getPlaceRelatedTo() {
		return this.placeRelatedTo;
	}

	public void setPlaceRelatedTo(Place placeRelatedTo) {
		this.placeRelatedTo = placeRelatedTo;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((this.placeRelatedTo == null) ? 0 : this.placeRelatedTo.hashCode());
		return result;
	}

	@Override
	public boolean equals(java.lang.Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		PlaceDescription other = (PlaceDescription) obj;
		if (this.placeRelatedTo == null) {
			if (other.placeRelatedTo != null) {
				return false;
			}
		}
		else if (!this.placeRelatedTo.equals(other.placeRelatedTo)) {
			return false;
		}
		return true;
	}
}
